package io;

import java.io.FileInputStream;
import java.io.IOException;

public class Test {

    public static void main(String[] args) throws IOException {
        FileInputStream fileInputStream = new FileInputStream("..\\shiqiCoreClone\\src\\main\\java\\io\\FileInputStreamTest.java");
        System.out.println(fileInputStream.read());

        //创建字节数组
        byte[] b = new byte[1024];
        //保存已读字节数
        int hasRead;
        while((hasRead=fileInputStream.read(b))>0){
            //取出已读字节,将字节数组转换成字符串输入
            System.out.println(new String(b,0,hasRead));
        }
        fileInputStream.close();

    }
}
